<?php
/**
 * Created by PhpStorm.
 * User: 94004
 * Date: 2017/12/29
 * Time: 10:33
 */
header("Content-Type:text/html;charset=utf-8;");
require_once "../util/db_helper.php";
$id = $_POST["id"];
$sql = " SELECT * FROM categories c WHERE id={$id}";
$res = query($sql);
$arr = array("code" => 101, "msg" => "操作失败");
if ($res) {
    $arr["code"] = 100;
    $arr["msg"] = "操作成功";
    $arr["data"] = $res[0];
}
echo json_encode($arr, JSON_UNESCAPED_UNICODE);
?>